package com.njwb.consumer.remote.service;

import com.njwb.common.json.ResponseResult;
import com.njwb.common.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
@Service
@FeignClient(value = "spring-cloud-nacos-provider")//服务提供者名称
public interface FeignRemoteUserService {
//    @PostMapping("/user")
//    public ResponseResult add(@RequestParam("username") String username,
//                              @RequestParam("password") String password);

//    @PostMapping("/user")
//    public ResponseResult add(@RequestBody  User user);

    @PostMapping("/user")
    public ResponseResult add(@SpringQueryMap User user);
    @DeleteMapping("/user/{id}")
    public ResponseResult delById(@PathVariable("id") Integer id);


    @PutMapping("/user")
    public ResponseResult modify(@RequestParam("id") Integer id,
                                 @RequestParam("username") String username,
                                 @RequestParam("password") String password);
    @GetMapping("/user/{id}")
    public ResponseResult getById(@PathVariable("id") Integer id);

    @GetMapping("/user")
    public ResponseResult findAll();
}